﻿namespace ChinaUnicom
{
    using System;

    public static class DateTimeExtensions
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="time"></param>
        /// <param name="timeout">minutes</param>
        /// <returns></returns>
        public static bool IsOutdated(this DateTime time, int timeout = 360)
        {
            return (DateTime.Now - time).TotalMinutes > timeout;
        }

        public static DateTime ToMonthFirstDate(this DateTime time)
        {
            return new DateTime(time.Year, time.Month, 1);
        }
    }
}
